package com.lecyon.farm.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lecyon.farm.base.BaseRequestPageVo;
import com.lecyon.farm.base.RestResponse;
import com.lecyon.farm.service.IFmWorkTotalService;
import com.lecyon.farm.vo.query.QueryFmWorkVo;
import com.lecyon.farm.vo.view.FmStatisticDataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * VIEW 前端控制器
 * </p>
 *
 * @author YaoZheng
 * @since 2020-04-02
 */
@RestController
@RequestMapping("/fm-work-total")
@Api(tags = "农机作业统计数据")
@ResponseBody
@CrossOrigin
public class FmWorkTotalController {

    private IFmWorkTotalService fmWorkTotalService;

    @Autowired
    public FmWorkTotalController(IFmWorkTotalService fmWorkTotalService) {
        this.fmWorkTotalService = fmWorkTotalService;
    }

    @ApiOperation(value = "查询作业统计列表(F0101)", notes = "查询作业统计列表(分页)，author:YaoZheng")
    @PostMapping(value = "/getList")
    public RestResponse<Page<FmStatisticDataVo>> getTotalPageList(@RequestBody @Valid BaseRequestPageVo<QueryFmWorkVo> vo) {
        return fmWorkTotalService.getTotalDataList(vo);
    }

}
